package com.vehicle.admin.web.common.freemarker;

import com.jagregory.shiro.freemarker.ShiroTags;
import freemarker.ext.jsp.TaglibFactory;
import freemarker.template.Configuration;
import freemarker.template.TemplateException;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

import java.io.IOException;

public class FreeMarkerConfigExtend extends FreeMarkerConfigurer {

    @Override
    public void afterPropertiesSet() throws IOException, TemplateException {
        super.afterPropertiesSet();
        Configuration cfg=this.getConfiguration();
        cfg.setSharedVariable("shiro",new ShiroTags());//shiro标签
        cfg.setNumberFormat("#");//防止页面输出数字，变成2,000
    }
}
